package account

const (
	rulePhone  = `^1[3456789]\d{9}$`
	ruleQQ     = `(^[1-3]{1}\d{4,9}$)|(^[1-9]{1}\d{4,8}$)`
	ruleWechat = `^[a-zA-Z]([-_a-zA-Z0-9]{5,19})$`
	ruleEmail  = `^([a-zA-Z0-9]+[\w\-\.]*\@[a-zA-Z0-9]+[\w\-]*(\.[\w\-]+)+)$`
	ruleZSH    = `^100011\d{13}$`
	ruleZSY    = `^(90|95|70)\d{14}$`
)

// IsPhone 验证是否是手机号
func IsPhone(mobile string) bool {
	return match(rulePhone, mobile)
}

// IsQQ 验证是否是QQ账号
func IsQQ(mobile string) bool {
	return match(ruleQQ, mobile)
}

// IsWechat 验证是否是微信账号
func IsWechat(mobile string) bool {
	return match(ruleWechat, mobile)
}

// IsEmail 验证是否是邮箱
func IsEmail(mobile string) bool {
	return match(ruleEmail, mobile)
}

// IsZSH 验证是否是中石化账号
func IsZSH(mobile string) bool {
	return match(ruleZSH, mobile)
}

// IsZSY 验证是否是中石油账号
func IsZSY(mobile string) bool {
	return match(ruleZSY, mobile)
}
